package cn.edu.ldu.util;

import java.io.Serializable;
import java.net.InetAddress;

/**
 * Message，消息类，定义会话消息结构，规定会话协议。
 * 
 */
public class Message implements Serializable {
    private String userId=null; //用户id
    private String password=null; //密码
    private String userId2  = null;
    private String password1=null;
    private String password2= null;
    private String nickname=null;
    private String type=null; //消息类型：M_REGISTER:用户注册消息 M_LOGIN:用户登录消息；M_SUCCESS:登录成功；M_FAULURE:登录失败；M_ACK:服务器对登录用户的回应消息；M_MSG:会话消息；M_QUIT:用户退出消息
    private String text=null; //消息体
    private InetAddress toAddr=null; //目标用户地址
    private int toPort; //目标用户端口
    private String targetId=null; //目标用户id

    /**
     * @return the userId
     */
    public String getUserId() {
        return userId;
    }

    /**
     * @param userId the userId to set
     */
    public void setUserId(String userId) {
        this.userId = userId;
    }

    /**
     * @return the password
     */
    public String getPassword() {
        return password;
    }

    /**
     * @param password the password to set
     */
    public void setPassword(String password) {
        this.password = password;
    }

    /**
     * @return the userId2
     */
    public String getUserId2() {
        return userId2;
    }

    /**
     * @param userId2 the userId2 to set
     */
    public void setUserId2(String userId2) {
        this.userId2 = userId2;
    }

    /**
     * @return the password1
     */
    public String getPassword1() {
        return password1;
    }

    /**
     * @param password1 the password1 to set
     */
    public void setPassword1(String password1) {
        this.password1 = password1;
    }

    /**
     * @return the password2
     */
    public String getPassword2() {
        return password2;
    }

    /**
     * @param password2 the password2 to set
     */
    public void setPassword2(String password2) {
        this.password2 = password2;
    }

    /**
     * @return the nickname
     */
    public String getNickname() {
        return nickname;
    }

    /**
     * @param nickname the nickname to set
     */
    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    /**
     * @return the type
     */
    public String getType() {
        return type;
    }

    /**
     * @param type the type to set
     */
    public void setType(String type) {
        this.type = type;
    }

    /**
     * @return the text
     */
    public String getText() {
        return text;
    }

    /**
     * @param text the text to set
     */
    public void setText(String text) {
        this.text = text;
    }

    /**
     * @return the toAddr
     */
    public InetAddress getToAddr() {
        return toAddr;
    }

    /**
     * @param toAddr the toAddr to set
     */
    public void setToAddr(InetAddress toAddr) {
        this.toAddr = toAddr;
    }

    /**
     * @return the toPort
     */
    public int getToPort() {
        return toPort;
    }

    /**
     * @param toPort the toPort to set
     */
    public void setToPort(int toPort) {
        this.toPort = toPort;
    }

    /**
     * @return the targetId
     */
    public String getTargetId() {
        return targetId;
    }

    /**
     * @param targetId the targetId to set
     */
    public void setTargetId(String targetId) {
        this.targetId = targetId;
    }
    

  
    


}
